import { NativeModules } from 'react-native';

const { EzvizRoute } = NativeModules;
// interface NavigationTool {
//     startBiz: (biz: string, entry: string, params?: object) => void;
//     popPage: () => void;
//     popToRoot: () => void;
//     canPop: () => boolean;
//     popTo: (index: number) => void;
//     seleTab: (index: number) => void;
// }
const navigationTool = {
    startBiz: (biz: string, entry: string, params: { [key: string]: any }) => {
        EzvizRoute?.startReactNative(biz, entry, params);
    },
    popPage: (animated: boolean = true) => {
        EzvizRoute?.popViewControllerAnimated(animated);
    },
    popToRoot: (animated: boolean = true) => {
        EzvizRoute?.popToRootViewControllerAnimated(animated);
    },
    canPop: () => {
        EzvizRoute?.canPopViewController();
    },
    popTo: (page: string, animated: boolean = true) => {
        EzvizRoute?.popToViewController(page, animated);
    },
    seleTab: (index: string) => {
        EzvizRoute?.selectTabWithIndex(index);
    },
};
export default navigationTool;
